import React from "react";
import styled from "styled-components";
import loadingGif from "../../assets/images/loading.gif";

const LoadingWrapper = styled.div`
  width: 100%;
  height: 200px;
  background: url(${props => props.loading}) no-repeat center center;
  background-size: 20px;
`;

export default function Loading(props) {
  const { show, loadNone } = props;
  return show ? (
    loadNone ? (
      <div style={{ padding: "20px 0", textAlign: "center", fontSize: 14 }}>
        暂无搜索结果
      </div>
    ) : (
      <LoadingWrapper loading={loadingGif}></LoadingWrapper>
    )
  ) : null;
}
